import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import pxtovw from 'postcss-px-to-viewport'
const loder_pxtovw = pxtovw({
  unitToConvert: "px",
  viewportWidth: 375,
  unitPrecision: 3,
  viewportUnit: "vw",
  mediaQuery: false, // 媒体查询里的单位是否需要转换单位
})

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  plugins: [vue()],
  server: {
    port: 5173,
    host: '0.0.0.0'
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src")
    }
  },
  css: {
    postcss: {
      plugins: [loder_pxtovw]
    }
  },
})
